﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GrewalCRM.Entities;

namespace GrewalCRM.Entities
{
  public class CustomersMaster : BaseEntitiesGrewalCRM
  {
    #region Members   
    private string customerName;
		private string address;
		private string zipCode;
		private string phoneNo;
		private string mobileNo1;
    private string mobileNo2;    
    #endregion

    #region Constructors
    /// <summary>
    /// Create a new instance using the default constructor
    /// </summary>
    public CustomersMaster():base()
    {      
    }

    /// <summary> 
    /// Create a new object using the minimum required information (all not-null fields except 
    /// auto-generated primary keys). 
    /// </summary> 
    public CustomersMaster(string customerName, string address, string zipCode, UserCRM lastModifiedUser)
      : base(lastModifiedUser)
    {
      this.customerName = customerName;
      this.address = address;
      this.zipCode = zipCode;      
    }
    

    /// <summary> 
    /// Create a new object by specifying all fields (except the auto-generated primary key field). 
    /// </summary> 
    public CustomersMaster(string customerName, string address, string zipCode, string phoneNo, string mobileNo1, string mobileNo2, UserCRM lastModifiedUser)
      : base(lastModifiedUser)
    {

      this.customerName = customerName;
      this.address = address;
      this.zipCode = zipCode;
      this.phoneNo = phoneNo;
      this.mobileNo1 = mobileNo1;
      this.mobileNo2 = mobileNo2;  
    }





    /// <summary> 
    /// Create an object from an existing row of data with only ID feild 
    /// </summary> 
    public CustomersMaster(int customerID)
      : base(customerID, null, null)
    {

    }

    /// <summary> 
    /// Create an object from an existing row of data. This will be used by Gentle to 
    /// construct objects from retrieved rows. 
    /// </summary> 
    public CustomersMaster(int customerID, string customerName, string address, string zipCode, string phoneNo, string mobileNo1, string mobileNo2, UserCRM lastModifiedUser, DateTime? lastModifiedDateTime)
      : base(customerID, lastModifiedUser, lastModifiedDateTime)
    {
      this.customerName = customerName;
      this.address = address;
      this.zipCode = zipCode;
      this.phoneNo = phoneNo;
      this.mobileNo1 = mobileNo1;
      this.mobileNo2 = mobileNo2;      
    }
    #endregion

    #region Public Properties    
    /// <summary>
    /// Property relating to database column customerName
    /// </summary>
    
    public string CustomerName
    {
      get { return customerName; }
      set { IsChanged |= customerName != value; customerName = value; }
    }

    /// <summary>
    /// Property relating to database column Address
    /// </summary>
    
    public string Address
    {
      get { return address; }
      set { IsChanged |= address != value; address = value; }
    }

    /// <summary>
    /// Property relating to database column ZipCode
    /// </summary>
    
    public string ZipCode
    {
      get { return zipCode; }
      set { IsChanged |= zipCode != value; zipCode = value; }
    }

    /// <summary>
    /// Property relating to database column PhoneNo
    /// </summary>
    
    public string PhoneNo
    {
      get { return phoneNo; }
      set { IsChanged |= phoneNo != value; phoneNo = value; }
    }

    /// <summary>
    /// Property relating to database column MobileNo
    /// </summary>
    
    public string MobileNo1
    {
      get { return mobileNo1; }
      set { IsChanged |= mobileNo1 != value; mobileNo1 = value; }
    }
    
    public string MobileNo2
    {
      get { return mobileNo2; }
      set { IsChanged |= mobileNo2 != value; mobileNo2 = value; }
    }

    #endregion
  }
}
